package com.oauth.common.server;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.gwtwidgets.server.spring.GWTSpringController;

import com.oauth.common.server.beans.OAuthConfigBean;
import com.oauth.service.generic.OAuthService;

public abstract class OAuthGwtController extends GWTSpringController {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5239334872156168995L;

	protected OAuthConfigBean mOAuthConfigBean;

	protected String mTokenCookie;
	protected String mTokenSecretCookie;
	protected OAuthService mOAuthService;

	protected HttpServletResponse getHttpResponse() {
		return getThreadLocalResponse();
	}

	protected HttpServletRequest getHttpRequest() {
		return getThreadLocalRequest();
	}

	public OAuthConfigBean getOAuthConfigBean() {
		return mOAuthConfigBean;
	}

	public void setOAuthConfigBean(OAuthConfigBean pAuthConfigBean) {
		mOAuthConfigBean = pAuthConfigBean;
	}

	protected String getConsumerSecret() {
		return getOAuthConfigBean().getConsumerSecret();
	}

	protected String getConsumerKey() {
		return getOAuthConfigBean().getConsumerKey();
	}

}
